﻿///<reference path="jquery-1.4.1-vsdoc.js"/>

$(document).ready(function () {

    $(".entry-form").hide().fadeIn("slow");

    $("#UserName").focus(); // Put the username field in focus on page load.
    $("#title").focus();

    $(".register-form").hide().fadeIn("slow");
    $(".login-form").hide().fadeIn("slow");

    $("#UserName").focus(); // Put the username field in focus on page load.	
});

function loadCategories() {
    $.ajax({
        type: "GET",
        contentType: "application/json; charset=utf-8",
        url: "/Home/LoadCategories/",
        data: "{}",
        dataType: "json",
        success: function (data) {
            ($("#category-template").tmpl(data).prependTo(".category-dropdown"));
        },
        error: function (xhr, err) {
            // Note: just for debugging purposes!
            console.log("readyState: " + xhr.readyState +
                            "\nstatus: " + xhr.status);
            console.log("responseText: " + xhr.responseText);
        }
    });
}